const { Router } = require('express')
const express = require('express')
const qs = require('querystring')
//路由容器
const searchShop = express.Router()
const axios = require('axios')

searchShop.get('/getAllLikeHome', (req, res) => {
    let {content, setting} = req.query
    content = decodeURIComponent(content)
    setting = decodeURIComponent(setting)
    console.log(content);
    console.log(setting);
    axios({
        url:'http://www.mianded.top:8081/goods/getAllLikeHome',
        method:'GET',
        params:{
            content:content,
            setting:setting
        },
        headers:{
            token:req.session.token?req.session.token:""
        }
    })
    .then(data=>{
        console.log('2666666666666666666666666666666666');
        console.log(data.data.data);
        res.status(200).json({
            data:data.data.data
        })
    })
    .catch(err => {
        res.status(200).json({
            err:err
        })
    })
})

module.exports=searchShop;